﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Aesha.WoW.Broker.Infrastructure;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Aesha.WoW.Broker.Tests
{
    [TestClass]
    public class BattleNetRepositoryTests
    {
        [TestMethod]
        public void GetAuctionDataUpdateTest()
        {
            var repository = new BattleNetRepository();
            var update = repository.GetLatestAuctionDataUpdate();

            Assert.IsNotNull(update.Url);
            Assert.IsNotNull(update.LastModified);
        }

        [TestMethod]
        public void GetAuctionListsings()
        {
            var repository = new BattleNetRepository();
            var update = repository.GetLatestAuctionDataUpdate();

            var listsings = repository.GetListings(new Uri(update.Url));
            Assert.IsTrue(listsings.Count > 0);
        }

        [TestMethod]
        public void GetItemClasses()
        {
            var repository = new BattleNetRepository();
            var itemClasses = repository.GetItemClasses();
            
            Assert.IsTrue(itemClasses.Count > 0);
        }


    }
}
